﻿<html xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <meta name="description" content="">
  <meta name="author" content="">
  <title>档案管理系统-用户登录</title>
  <!-- 所有script封装到一起 -->
  <div th:replace="user/common/scriptBar :: script"  ></div>
</head>
<body class="bg-gradient-primary">
<div class="container">
  <div class="row justify-content-center">
    <div class="col-xl-10 col-lg-12 col-md-9">
      <div class="card o-hidden border-0 shadow-lg my-5">
        <div class="card-body p-0">
          <div class="row">
            <div class="col-lg-6 d-none d-lg-block bg-login-image"
                 style="background-image: url('../admin/img/login_pic.jpg')"></div>
            <div class="col-lg-6">
              <div class="p-5">
                <div class="text-center">
                  <h1 class="h4 text-gray-900 mb-4">用户登录</h1>
                </div>
                <form class="user" action="./userLogin" method="post" name="loginForm">
                  <!--判断-->
                  <p style="color: red" th:text="${msg}" th:if="${not #strings.isEmpty(msg)}"></p>
                  <div class="form-group">
                    <input type="text" name="userId" placeholder="Username" class="form-control form-control-user" id="exampleInputEmail" aria-describedby="emailHelp">
                  </div>
                  <div class="form-group">
                    <input type="password" name="userPassword" placeholder="Password" class="form-control form-control-user" id="exampleInputPassword">
                    <!--<input type="hidden" name="type" id="type" value="">-->
                  </div>
                  <div class="form-group">
                    <div style="float: right;"><input type="tel" name="verifyInput"  class="form-control form-control-user" style="width:150px;" placeholder="请输入验证码" maxlength="4"></div>
                    <a href="javascript:void(0);" title="点击更换验证码">
                      <div style="float: left"><img id="imgVerify" src="../login/getVerify" alt="更换验证码" height="36" width="170" onclick="getVerify(this);"></div>
                    </a>
                    <br><br>
                  </div>
                  <div class="form-group">
                    <div class="custom-control custom-checkbox small">
                      <input type="checkbox" class="custom-control-input" id="customCheck">
                      <label class="custom-control-label" for="customCheck">Remember Me</label>
                    </div>
                  </div>
                  <button id="btn3" type="button" class="btn btn-primary btn-user btn-block" onclick="adminLogin()">登录</button>
                  <hr>
                  <div class="text-center">
                    <a class="small" href="./insertUserInfoView">创建一个账户!</a>
                  </div>
                </form>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
</body>
<script type="text/javascript">
  function adminLogin() {
    //$("#type").attr("value","admin");
    document.loginForm.submit();
  }
  /** 获取验证码函数 */
  function getVerify() {
    $("#imgVerify").attr("src", '../login/getVerify?' + Math.random());//jquery方式
  }
</script>
</html>
